﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="WPBlogMenu.PersonTileWithFlip"
	>
	<UserControl.Resources>
		<Storyboard x:Name="Slide" RepeatBehavior="Forever">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4.2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="37.5">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:8.3" Value="37.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:9" Value="75">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:13" Value="75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:13.8" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:17" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.6" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.8" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="grid">
				<EasingDoubleKeyFrame KeyTime="0:0:17" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.6" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.8" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="grid">
				<EasingDoubleKeyFrame KeyTime="0:0:17" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.6" Value="90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.8" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="grid">
				<EasingDoubleKeyFrame KeyTime="0:0:17" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid2">
				<DiscreteObjectKeyFrame KeyTime="0:0:17.2">
					<DiscreteObjectKeyFrame.Value>
						<Visibility>Visible</Visibility>
					</DiscreteObjectKeyFrame.Value>
				</DiscreteObjectKeyFrame>
				<DiscreteObjectKeyFrame KeyTime="0:0:22.4">
					<DiscreteObjectKeyFrame.Value>
						<Visibility>Visible</Visibility>
					</DiscreteObjectKeyFrame.Value>
				</DiscreteObjectKeyFrame>
				<DiscreteObjectKeyFrame KeyTime="0:0:22.6">
					<DiscreteObjectKeyFrame.Value>
						<Visibility>Collapsed</Visibility>
					</DiscreteObjectKeyFrame.Value>
				</DiscreteObjectKeyFrame>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="grid2">
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.6" Value="90"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid2">
				<EasingDoubleKeyFrame KeyTime="0:0:22.4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:22.6" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="grid">
				<EasingDoubleKeyFrame KeyTime="0:0:13.8" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:17.2" Value="0.5"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot" Width="75" Height="75" Loaded="LayoutRoot_Loaded">
		<Grid x:Name="grid1" Height="75" Width="75" Clip="M-7.4505806E-07,5.9604645E-07 L75,5.9604645E-07 L75,75 L-7.4505806E-07,75 z" >
			<Grid.Projection>
				<PlaneProjection/>
			</Grid.Projection>
            <Grid x:Name="grid" Height="150" Width="75" Margin="0,-75,0,0" RenderTransformOrigin="0.5,0.5" Background="{Binding TileColor}" >
				<Grid.Projection>
					<PlaneProjection/>
				</Grid.Projection>
				<Grid.RenderTransform>
					<CompositeTransform/>
				</Grid.RenderTransform>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition />
				</Grid.RowDefinitions>
                <TextBlock Text="{Binding TileFrontTextLine1}" Foreground="White" Margin="5,0,0,15" VerticalAlignment="Bottom" FontSize="15" />
                <TextBlock Text="{Binding TileFrontTextLine2}" Foreground="White" Margin="5,0,0,0" VerticalAlignment="Bottom" FontSize="15" />
                <Image Source="{Binding TileImage}" Tag="images/Me.jpg" Grid.Row="1" />
			</Grid>
            <Grid x:Name="grid2" Height="75" Width="75" Visibility="Collapsed" Background="{Binding TileColor}" RenderTransformOrigin="0.5,0.5" >
				<Grid.RenderTransform>
					<CompositeTransform/>
				</Grid.RenderTransform>
				<Grid.Projection>
					<PlaneProjection/>
				</Grid.Projection>
                <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5" TextWrapping="Wrap" Foreground="White" Text="{Binding TileBackText}" FontSize="{Binding FontSize}" TextTrimming="WordEllipsis" Padding="0" />
			</Grid>	
		</Grid>
        <Button Click="Button_Click" Opacity="0.001" />
	</Grid>
</UserControl>